package com.retail.lottery.colalottery.controller;

import com.retail.lottery.colalottery.annotation.EncryptResponse;
import com.retail.lottery.colalottery.service.CommonService;
import com.retail.lottery.colalottery.vo.ResultVO;
import com.retail.lottery.colalottery.vo.request.LotteryTimeRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/lotteryQuery")
@Slf4j
public class LotteryController {

    @Resource
    private CommonService commonService;

    /**
     * 抽奖机会查询
     *
     * @param request
     * @return
     */
    @EncryptResponse
    @RequestMapping(value = "/lotteryTimeQuery", method = RequestMethod.POST)
    public ResultVO<?> lotteryTimeQuery(@RequestBody LotteryTimeRequest request) {
        return ResultVO.succ(commonService.lotteryTimeQuery(request));
    }

}

